# str1="123456abc"
# str2="abcde"
# str3="迪丽热巴"
#
#
#
# def my_len(data):
#
#     count=0
#     for x in data:
#         count+=1
#     # print(f"{data}的长度是{count}")
#     return count
#
# my_len(str1)
# my_len(str2)
# my_len(str3)
# len1=my_len(str1)
# len2=my_len(str2)
# len3=my_len(str3)
# print(len1)
# print(len2)
# print(len3)
#
# def add(a,b):
#     """
#     实现两数字相加求和
#     :param a:
#     :param b:
#     :return:
#     """
#     return a+b
# add(1,2)
#

print("-----------案例 银行存款取款----------")
# def menu():
#     print("您好，欢迎来到曾氏银行ATM请选择操作：\n"
#       "查询余额【请输入1】\n"
#       "存款【请输入2】\n"
#       "取款【请输入3】\n"
#       "退出【请输入4】\n"
#       "请输入您的选择：")
#     money = 100
#     choice = int(input())
#     if choice == 1:
#         print(f"你的余额为{money}")
#         menu()
#     elif choice == 2:
#         money += int(input("请输入你打算存入："))
#         print(f"你的余额为{money}")
#         menu()
#     elif choice == 3:
#         money -= int(input("你打算取多少钱呢？"))
#         print(f"你的余额为{money}")
#         menu()
#

money=100
def menu():
    print("您好，欢迎来到曾氏银行ATM请选择操作：\n"
      "查询余额【请输入1】\n"
      "存款【请输入2】\n"
      "取款【请输入3】\n"
      "退出【请输入4】\n")
    return int(input("请输入您的选择："))


while True:
    choice=menu()
    if choice==4:
        print("你已结束服务")
        break
    elif choice==1:
        print(f"你的余额为：{money}")
    elif choice==2:
        money+=int(input("请输入存款金额："))
        print(f"你的余额为：{money}")
    elif choice==3:
        money -= int(input("请输入取款金额："))
        print(f"你的余额为：{money}")


